package top.zy.model.event.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import top.zy.model.event.event.UserRegisterEvent;
import top.zy.model.event.service.EmailService;

/**
 * @author ZackYoung
 * @version 1.0
 * @date 2021/12/26
 */
@Service
@Slf4j
public class EmailServiceImpl implements EmailService {
    /**
     * Handle an application event.
     *
     * @param event the event to respond to
     */
    @Override
    @Async
    public void onApplicationEvent(UserRegisterEvent event) {
        log.info("[onApplicationEvent][给用户（{}）发送邮件]",event.getUsername());
    }
}
